package personal.vivian.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import personal.vivian.beans.FactoryBeanService;
import personal.vivian.beans.FactoryBeanServiceImpl;
import personal.vivian.filter.ModifyParameterFilter;

@Configuration
public class AppConfig {
    @Bean(name = "FactoryBeanService")
    public FactoryBeanService factoryBeanService(){
        FactoryBeanService factoryBeanService = new FactoryBeanServiceImpl();
        return factoryBeanService;
    }
    //@Bean
    public FilterRegistrationBean my(){
        FilterRegistrationBean my = new FilterRegistrationBean();
        my.addUrlPatterns("/*");
        my.setFilter(new ModifyParameterFilter());
        return my;
    }
}
